home *** CD-ROM | disk | FTP | other *** search
/ Multi Active Maximuzer 3.0is / MultiActive Maximuzer 3.0is.iso / sirnet / scripts / scripts.z / CONNECT.SCR < prev    next >
Text File  |  1996-03-22  |  9KB  |  383 lines

  1. !
  2. !  Copyright (c) 1995
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  CONNECT:
  9. !    Handles CompuServe and Direct.
  10. !
  11. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  12. !    modified since other utility programs may assume the relationships
  13. !    of network names and network ids specified below.
  14. !
  15. !+V
  16. ! "3.8"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;        ! "CompuServe"
  21. AlaskaNet = 36;         ! "AlaskaNet"
  22. Chilepac= 28;        ! "Chilepac"
  23. CSIRnet = 16;        ! "CSIR-Net"
  24. DataPac = 4;        ! "DataPac"
  25. Datex_J = 19;        ! "Datex-J"
  26. Datex_P = 10;        ! "Datex-P"
  27. EIRPAC = 33;            ! "EIRPAC"
  28. FENICSII = 24;        ! "FENICS II"
  29. FTConnect = 12;         ! "FT-Connect"
  30. Dialplus = 11;        ! "GNS Dialplus"
  31. InfoNet_Europe = 5;    ! "InfoNet-Euro"
  32. InfoNet_Korea = 29;    ! "InfoNet-Kor"
  33. InfoNet_Mexico = 31;    ! "InfoNet-Mex"
  34. InfoNet_SAfrica = 32;    ! "InfoNet-RSA"
  35. InfoNet_Taiwan = 30;    ! "InfoNet-Taiw"
  36. InfoNet_World = 6;    ! "InfoNet-Wrld"
  37. Internet = 25;        ! "Internet"
  38. ISRAKAV = 17;        ! "ISRAKAV"
  39. LATA = 7;        ! "LATA"
  40. CTLATA = 8;        ! "LATA-Ct"
  41. Mercury = 15;        ! "Mercury"
  42. PacNet = 21;        ! "PacNet"
  43. PosServe = 27;        ! "Pos-Serve LL"
  44. SCITOR = 34;            ! "SCITOR"
  45. SEVA = 35;              ! "SEVA"
  46. Telenet = 2;        ! "SprintNet"
  47. Telepac = 9;        ! "Telepac"
  48. Transpac = 18;        ! "Transpac"
  49. TTNNet = 22;        ! "TTN-Net"
  50. Tymnet = 3;        ! "Tymnet"
  51. VNZNET = 23;        ! "VNZ-Net"
  52. Direct = 40;    ! "Direct"
  53. !-N
  54.  
  55. define %CR = "^M";
  56. define %FALSE = 0;
  57. define %TRUE = 1;
  58. define %ErrorCode = 0;
  59. define %PPP = "";
  60. hangup = 1;
  61. UsingModem = %FALSE;
  62. CISNetwork = %FALSE;
  63.  
  64. !
  65. ! Main Program
  66. !
  67. init %Port, %BaudRate;
  68. if %_init goto Continue_Connect;
  69.  
  70. define %FailureMsg = "Could not initialize port";
  71. define %ErrorCode = 2;
  72. if %Network <> Internet goto Connect_Fatal;
  73. define %ErrorCode = 3;
  74. goto Connect_Fatal;
  75.  
  76. Continue_Connect:
  77.     call %Dir & "first.scr" () : Result;
  78.     if Result = %Cancel goto Cancel_Connect;
  79.     if Result = %Failure goto Connect_Failure;
  80.     if Result = %Fatal goto Connect_Fatal;
  81.  
  82.     on cancel goto Cancel_Connect;
  83.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  84.  
  85.     if DirectConnect goto Connect_Network;
  86.  
  87.     call %Dir & "phone.scr" () : Result;
  88.  
  89.     if Result = %Cancel goto Cancel_Connect;
  90.     if Result = %Failure goto Connect_Failure;
  91.     if Result = %Fatal goto Connect_Fatal;
  92.     UsingModem = %TRUE;
  93.  
  94. Connect_Network:
  95.     if %Network = CompuServe goto Connect_CIS;
  96.     if %Network = Direct goto Connect_CIS;
  97.     if %Network = Telenet goto Connect_Telenet;
  98.     if %Network = Tymnet goto Connect_Tymnet;
  99.     if %Network = DataPac goto Connect_DataPac;
  100.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  101.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  102.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  103.     if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
  104.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  105.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  106.     if %Network = Internet goto Connect_CIS;
  107.     if %Network = LATA goto Connect_LATA;
  108.     if %Network = CTLATA goto Connect_CTLATA;
  109.     if %Network = Telepac goto Connect_Telepac;
  110.     if %Network = Datex_P goto Connect_Datex_P;
  111.     if %Network = Datex_J goto Connect_Datex_J;
  112.     if %Network = Dialplus goto Connect_Dialplus;
  113.     if %Network = Mercury goto Connect_Mercury;
  114.     if %Network = CSIRnet goto Connect_CSIRnet;
  115.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  116.     if %Network = Transpac goto Connect_Transpac;
  117.     if %Network = PacNet goto Connect_PacNet;
  118.     if %Network = PosServe goto Connect_PosServe;
  119.     if %Network = TTNNet goto Connect_TTNNet;
  120.     if %Network = FENICSII goto Connect_FENICSII;
  121.     if %Network = VNZNET goto Connect_CIS;
  122.     if %Network = Chilepac goto Connect_Chilepac;
  123.         if %Network = EIRPAC goto Connect_EIRPAC;
  124.         if %Network = SCITOR goto Connect_SCITOR;
  125.         if %Network = SEVA goto Connect_SEVA;
  126.         if %Network = AlaskaNet goto Connect_AlaskaNet;
  127.         if %Network = FTConnect goto Connect_FTConnect;
  128.  
  129.     define %FailureMsg = "Network not supported";
  130.     goto Connect_Fatal;
  131.  
  132. !
  133. !  Connect to Telenet
  134. !
  135. Connect_Telenet:
  136.     call %Dir & "telenet.scr" () : Result;
  137.     goto Handle_Network_Return;
  138.  
  139. !
  140. !  Connect to Tymnet
  141. !
  142. Connect_Tymnet:
  143.     call %Dir & "tymnet.scr" (1) : Result;
  144.     goto Handle_Network_Return;
  145.  
  146. !
  147. !  Connect to DataPac
  148. !
  149. Connect_DataPac:
  150.     call %Dir & "datapac.scr" () : Result;
  151.     goto Handle_Network_Return;
  152.  
  153. !
  154. !  Connect to InfoNet World
  155. !
  156. Connect_InfoNet_World:
  157.     call %Dir & "infonet.scr" (0) : Result;
  158.     goto Handle_Network_Return;
  159.  
  160. !
  161. !  Connect to InfoNet Europe
  162. !
  163. Connect_InfoNet_Europe:
  164.     call %Dir & "infonet.scr" (1) : Result;
  165.     goto Handle_Network_Return;
  166.  
  167. !
  168. !  Connect to InfoNet Korea
  169. !
  170. Connect_InfoNet_Korea:
  171.     call %Dir & "infonet.scr" (2) : Result;
  172.     goto Handle_Network_Return;
  173.  
  174. !
  175. !  Connect to InfoNet Taiwan
  176. !
  177. Connect_InfoNet_Taiwan:
  178.     call %Dir & "infonet.scr" (3) : Result;
  179.     goto Handle_Network_Return;
  180.  
  181. !
  182. !  Connect to InfoNet Mexico
  183. !
  184. Connect_InfoNet_Mexico:
  185.     call %Dir & "infonet.scr" (4) : Result;
  186.     goto Handle_Network_Return;
  187.  
  188. !
  189. !  Connect to InfoNet South Africa
  190. !
  191. Connect_InfoNet_SAfrica:
  192.     call %Dir & "infonet.scr" (5) : Result;
  193.     goto Handle_Network_Return;
  194.  
  195. !
  196. !  Connect to LATA
  197. !
  198. Connect_LATA:
  199.     call %Dir & "lata.scr" (%TRUE) : Result;
  200.     goto Handle_Network_Return;
  201.  
  202. !
  203. !  Connect to Connecticut LATA
  204. !
  205. Connect_CTLATA:
  206.     call %Dir & "lata.scr" (%FALSE) : Result;
  207.     goto Handle_Network_Return;
  208.  
  209. !
  210. !  Connect to Telepac
  211. !
  212. Connect_Telepac:
  213.     call %Dir & "telepac.scr" () : Result;
  214.     goto Handle_Network_Return;
  215.  
  216. !
  217. !  Connect to Datex-P
  218. !
  219. Connect_Datex_P:
  220.     call %Dir & "datexp.scr" () : Result;
  221.     goto Handle_Network_Return;
  222.  
  223. !
  224. !  Connect to Datex-J
  225. !
  226. Connect_Datex_J:
  227.     call %Dir & "datexj.scr" () : Result;
  228.     goto Handle_Network_Return;
  229.  
  230. !
  231. !  Connect to Dialplus
  232. !
  233. Connect_Dialplus:
  234.     call %Dir & "dialplus.scr" () : Result;
  235.     goto Handle_Network_Return;
  236.  
  237. !
  238. !  Connect to FT-Connect
  239. !
  240. Connect_FTConnect:
  241.         call %Dir & "ftconn.scr" () : Result;
  242.     goto Handle_Network_Return;
  243.  
  244. !
  245. !  Connect to Mercury
  246. !
  247. Connect_Mercury:
  248.     call %Dir & "mercury.scr" () : Result;
  249.     goto Handle_Network_Return;
  250.  
  251. !
  252. !  Connect to CSIR-Net
  253. !
  254. Connect_CSIRnet:
  255.     call %Dir & "csirnet.scr" () : Result;
  256.     goto Handle_Network_Return;
  257.  
  258. !
  259. !  Connect to ISRAKAV
  260. !
  261. Connect_ISRAKAV:
  262.     call %Dir & "israkav.scr" () : Result;
  263.     goto Handle_Network_Return;
  264.  
  265. !
  266. !  Connect to Transpac
  267. !
  268. Connect_Transpac:
  269.     call %Dir & "transpac.scr" () : Result;
  270.     goto Handle_Network_Return;
  271.  
  272. !
  273. !  Connect to AlaskaNet
  274. !
  275. Connect_AlaskaNet:
  276.     call %Dir & "tymnet.scr" (2) : Result;
  277.     goto Handle_Network_Return;
  278.  
  279. !
  280. !  Connect to PacNet
  281. !
  282. Connect_PacNet:
  283.     call %Dir & "tymnet.scr" (3) : Result;
  284.     goto Handle_Network_Return;
  285.  
  286.     
  287. !
  288. !  Connect to Pos-Serve
  289. !
  290. Connect_PosServe:
  291.     call %Dir & "posserve.scr" () : Result;
  292.     goto Handle_Network_Return;
  293.  
  294. !
  295. !  Connect to TTN-Net
  296. !
  297. Connect_TTNNet:
  298.     call %Dir & "ttnnet.scr" (3) : Result;
  299.     goto Handle_Network_Return;
  300.  
  301. !
  302. !  Connect to FENICS II
  303. !
  304. Connect_FENICSII:
  305.     call %Dir & "fenics2.scr" (3) : Result;
  306.     goto Handle_Network_Return;
  307.  
  308. !
  309. !  Connect to Chilepac
  310. !
  311. Connect_Chilepac:
  312.     call %Dir & "chilepac.scr" (3) : Result;
  313.     goto Handle_Network_Return;
  314.  
  315. !
  316. !  Connect to EIRPAC
  317. !
  318. Connect_EIRPAC:
  319.         call %Dir & "eirpac.scr" () : Result;
  320.     goto Handle_Network_Return;
  321.  
  322. !
  323. !  Connect to SCITOR
  324. !
  325. Connect_SCITOR:
  326.         call %Dir & "scitor.scr" () : Result;
  327.     goto Handle_Network_Return;
  328.  
  329. !
  330. !  Connect to SEVA
  331. !
  332. Connect_SEVA:
  333.         call %Dir & "seva.scr" () : Result;
  334.     goto Handle_Network_Return;
  335.  
  336.  
  337. !
  338. !  Handle Network Return
  339. !
  340. Handle_Network_Return:
  341.     if Result = %Success goto Do_CIS_Script;
  342.     if Result = %Cancel goto Cancel_Connect;
  343.     if Result = %Fatal goto Connect_Fatal;
  344.     goto Connect_Failure;
  345.  
  346. !
  347. !  Connect to CIS
  348. !
  349. Connect_CIS:
  350.     CISNetwork = %TRUE;
  351.     send %CR;
  352.  
  353. Do_CIS_Script:
  354.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  355.     if Result = %Failure goto Connect_Failure;
  356.     if Result = %Cancel goto Cancel_Connect;
  357.     if Result = %Fatal goto Connect_Fatal;
  358.     exit %Success;
  359.  
  360. Connect_Failure:
  361.     gosub Hangup_Connect;
  362.     reset;
  363.     exit %Failure;
  364.  
  365. Connect_Fatal:
  366.     gosub Hangup_Connect;
  367.     reset;
  368.     exit %Fatal;
  369.  
  370. Hangup_Connect:
  371.     if not UsingModem goto Hangup_Done;
  372.     define %LOCAL = 1;
  373.     call %Dir & "disconct.scr" ();
  374. Hangup_Done:
  375.     return;
  376.  
  377. Cancel_Connect:
  378.     show "Connect cancelled";
  379.     gosub Hangup_Connect;
  380.     reset;
  381.     define %ErrorCode = 1;
  382.     exit %Cancel;
  383.